﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Hackathon.Controllers
{
    public class AjaxServiceController : Controller
    {
        //
        // GET: /AjaxService/

        public ActionResult GetNewWord()
        {
            var tmp = Services.PearsonLongamnDictionaryService.GetRandomWord();
            //fill in some dummy scores
            var repo = new Repositories.WheelOfFortuneUserInfo();
            repo.Add(new Repositories.WheelofFortuneScore() { WordId = tmp.id, Score = new Random().Next(99999), UserName = DateTime.Now.ToLongTimeString() });

            return Json(tmp);
        }

        public ActionResult getHighScoreList()
        {
            var repo = new Repositories.WheelOfFortuneUserInfo();
            return Json(repo.GetTopScore(30));
        }

    }
}
